var middleNode = function(head){
  let fast = head;
  let slow = head;
  if(fast !== null && fast.next !== null){
    fast = fast.next.next;
    slow = slow.next;
  }
  return slow;
}